<template>
	<view style="display: flex; justify-content: center; align-items: center;">
		<view class="car-com-img">
			<image :src="carShop.src"></image>
		</view>
		<view>
			<view class="car-com-labs">
				{{carShop.name }}{{carShop.title}}
			</view>
			<view class="car-com-ls">
				{{carShop.title}}
			</view>
			<view @click.stop="sublick" class="car-com-price" style="padding-top: 30rpx; padding-left: 30rpx; padding-right: 40rpx;">
				<text style="color: red;">
					￥{{carShop.price}}
				</text>
				<view class="car-num" >
					<view style="padding-right: 20rpx; font-size: 40rpx;" @click="del(carShop)">-</view>
					<button size="mini">{{carShop.conunt}}</button>
					<view style="padding-left: 20rpx; font-size: 40rpx;" @click="add(carShop)">+</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	
	export default {
		name: "carCom",
		props:['carShop'],
		data() {
			return {

			}
		},
		methods:{
			del(carShop){
				if(carShop.conunt!=1){
					carShop.conunt=carShop.conunt-1;
				}
			},
			add(carShop){
				carShop.conunt=carShop.conunt+1;
				
			}
		}
	}
</script>

<style>

	.car-com-img {
		margin-top: 20rpx;
		width: 171rpx;
		height: 144rpx;
		background-color: #f8f8f8;
		border-radius: 20%;
	}

	.car-com-img image {
		width: 171rpx;
		height: 144rpx;
	}

	.car-com-labs {
		margin-left: 40rpx;
		width: 400rpx;
	}
	.car-com-ls{
		margin-top: 20rpx;
		margin-left: 40rpx;
		color: rgba(0, 0, 0, .85);
		background-color: rgba(0, 0, 0, 0.06);
		font-size: 25rpx;
		text-align: center;
		border-radius: 5%;
		width: 400rpx;
	}

	.car-com-price {
		display: flex;
		justify-content: space-between;
		margin-right: 20rpx;
	}
	.car-num{
		display: flex;
		align-items: center;
	}

</style>